%{
#include <stdio.h>
#include "y.tab.h"
#include "symtable.h"
#include "global.h"
%}
%%

 /* Comments
  * start with an #, expand to end of line
  */
#[^\n]*

\n			lines++;

 /* Data types */
int			yylval = INTEGER; return INTEGER;
float			yylval = FLOAT; return FLOAT;
struct			yylval = STRUCT; return STRUCT;
string			yylval = STRING; return STRING;

 /* Keywords and Identifiers */
world			return WORLD;

 /* This needs to be altered, insert should either check local scope or visible scope,
  * ideally it should be possible to search both
  */
[a-zA-Z][a-zA-Z0-9_]*	yylval = insert(yytext, UNDEFINED); return ID;

 /* Numbers */
[0-9]+			yylval = atoi(yytext); return NUMBER;

 /* Special characters */
\{			return '{';
\}			return '}';
;			return ';';
=			return '=';
\+			return '+';
\-			return '-';
\*			return '*';
\/			return '/';
\(			return '(';
\)			return ')';
,			return ',';
[ \t]+
\.			return '.';

%%
